index
Using PRINTVB To Produce Custom Formatted

Visual Basic Program Listings

Program Installation

Overview

Configure

File

Font Installation

Procedure Selection

Registration Via Mail

Compuserve Online Registration

Revision Notes

If you have questions or comments on this program, you can contact the author at:

Compuserve: 74220,2420	AOL: KyleSB	Internet: 74220.2420@compuserve.com

Kyle S. Brant

5441 Fenmore Road

Indianapolis, Indiana 46208

Visual Basic is a trademark of Microsoft Corporation

PKZIP and PKUNZIP are trademarks of PKWARE Inc.


OVERVIEW

PRINTVB is a highly configurable program that prints Visual Basic program listings in a format that you control.  Visual Basic .frm, .bas, .txt and .mak files can be printed using PRINTVB.  Comments, code, title line (which includes the file name only),  procedure header lines and page header lines(which includes date, time and page numbering) are selectably configurable for font size, font name, bold, italic or underline printing format.  The printout options are fully explained in the Configure help screen.  Fonts must be installed in the program before they are available in the Configure window for assignment to code, comments, or other portions of the printout.

PRINTVB can also print C or C++ listings since the FUNCTION/SUB reserved words are not normally found in C programs.  Simply turn off the EXCLUDE FORM/DECLARATIONS switch and the NEW PAGE EACH PROCEDURE switch and PRINTVB will print the listing and provide word wrap where appropriate, as well as page numbering, title, header and font control.  PRINTVB does not parse the C listing for comments yet, so the entire code printout will be formatted in the font selected for CODE.

Using PRINTVB

For PRINTVB to properly process your Visual Basic 2.0 Files, they must be saved in "TEXT" format.  To accomplish this you can use the FILE SAVE AS command from the menu bar to save individual .frm files in text format.  Optionally, you can select OPTIONS/ENVIRONMENT from the menu bar and alter the default "save" format from "binary" to "text".  Thereafter all file save operations will produce text format .frm files.

With Visual Basic 1.0 files the .frm files are proprietary binary files, and you must save the file as "text" with the CODE/SAVE TEXT menu bar command.

A typical usage of PRINTVB will include the following steps with optional steps indicated by "(optional)".

1.	Select or Open a Visual Basic file of the type: *.frm, *.bas, *.mak, *.txt by clicking the File Select button or using the FILE/SELECT FILE menu bar command.  If a .mak file is selected, a new dialog window will appear enabling you to choose "all files" listed in the .mak file or one or more selected files to print.  Note that the .mak file is included as one of the files shown in the list box, thereby enabling a printout of the .mak file as well as all files (.frm and .bas) listed in the .mak file.

2.	(Optional)  Click on the Procedure button or the OPTIONS/PROCEDURE SELECT menu bar entry to activate the procedure selection window and select individual procedures for inclusion in the printout.  Note:  by default, if no procedures are selected in the Procedure Select window, all procedures will be printed by PRINTVB.

3.	(Optional)  Click on the Fonts button or OPTIONS/INSTALL FONTS to alter the font list used by PRINTVB.  Note:  PRINTVB maintains a record of all settings and fonts in a file named PRINTVB.INI.

4.	(Optional)  Click on the Configure button or OPTIONS/CONFIGURE and configure the printout formatting options in the Configuration window.

5.	Click on the Print button or FILE/PRINT in the menu bar to activate printing of the selected file in accordance with the selected print formatting options.

Related Topics: Contents


install
Program Installation

PRINTVB is accompanied by at least the following necessary files in the compressed PKZIPped distribution file:

File Name	File Type	Destination Directory

1.	PRINTVB.EXE 	Main Executable file	Any Directory

2.	PRINTVB.HLP	Help file	With PRINTVB.EXE

3.	SPIN.VBX	Custom control file	C:\windows\system

4.	CMDIALOG.VBX	Custom control file	C:\windows\system

5.	README.TXT	Text file 	none required

6.	LICENSE.DOC	Text file	none required

The files should be installed into the appropriate directory in accordance with the above table.  Of course the above presumes that your hard drive is designated "C:".  If windows is located on your "D" (or other) hard drive or your windows directory has a pathname other than \windows\system then substitute the appropriate pathname.

PRINTVB.HLP should be located in the same directory as PRINTVB.EXE else it will not be found when accessed by PRINTVB.EXE.

PRINTVB.EXE will create a PRINTVB.INI file in its directory if this file cannot be found.  This file is a text file containing the setup information that PRINTVB loads upon initial execution.  CAUTION: do not change the entries in PRINTVB.INI using a text editor else you may alter the predefined format of the file and the code sequences necessary for the option feature lines to be recognized.  The parameters ARE case sensitive.  If you ever wish to return to the default settings of PRINTVB simply delete the PRINTVB.INI file located in the directory with PRINTVB.EXE.

CAUTION:  If upon unzipping the files you do not see the -AV parameter reported by PKUNZIP when authenticity verification is confirmed, then make certain to check for viruses or other contaminants that might be present.  The author cannot guarantee the programs are free from virus infection if you do not get the -AV report.

Related Topics: Contents


configure
Configuring PRINTVB

PRINTVB can be configured to print your program listings in many various formats.  I prefer not to waste paper printing out the "Form Declarations" so this option is one of my favorites over all other known techniques for printing Visual Basic program listings.

Fonts, Font Styles and Font Sizes are selectable for the following program listing sections:

1.	Program comments

2.	Program code

3.	Title Line (which includes the pathname of the file printed and the file name).

4.	Header Line (which includes the date, time and page number).

5.	Procedure Headers (the Sub or Function line that precedes each procedure).

Margin widths are easily selected using the up/down spin buttons.  For all printers, PRINTVB assumes that the unprintable area on each edge of the paper is 0.25 inches (as is typical with laser printers and most dot matrix printers).  Therefore, the margins you set in the CONFIGURATION dialog will be added to the built-in .25 inch margin.  Thus, to get a 0.5 inch margin, set the margins to 0.25 inches.  If odd printer behavior is noted, which entirely depends upon the printer driver used in your system, try increasing margin widths until what you desire printed appears on the paper.  One known odd printer  driver characteristic includes printing over perforations on continuous tractor feed paper with the top and bottom margins set to 0 inches.  Simply increase the bottom margin until the page break occurs where desired.

Line spacing should not be set any higher than "2" else much paper is wasted.

The Exclude Form Declarations checkbox (when checked) prevents printout of the Visual Basic control/form declarations.  I have yet to see much value in printing out this portion of a VB .frm source file.  To print the control/form declarations, this checkbox must be unchecked and "all procedures" (the program default) must be selected in the Procedure Selection dialog.

At the request of some users, PRINTVB will now print a single procedure per page if the New Page Each Procedure checkbox is checked.  This setting is optionally saved, or may be activated for the current execution of PRINTVB, as is the case with all of the configuration options.

A special header line may be entered in the text box at the bottom of the Configure dialog.  The header information entered in this box is saved permanently when you save the configuration of the program.  An alternate header may be entered during program execution of PRINTVB without saving it (as a special case header) and remains in effect so long as PRINTVB is running or minimized.

The Print Priority checkbox has three settings: LOW, MEDIUM and HIGH.  At the LOW setting PRINTVB gives Windows the CPU after processing each line in the file currently being processed for printing.  The Medium setting gives Windows the CPU every 16 lines, and the HIGH setting gives Windows the CPU every 63 lines of text processed from the selected or opened file.  The Print Priority setting is designed to enable execution of other programs while parsing and processing of the selected by PRINTVB takes place.  If you want the fastest processing by PRINTVB to take place, then choose the HIGH setting, and PRINTVB will give up the CPU to Windows less often.  In reality, this option controls task priority for PRINTVB.

PRINTVB will Autominimize (minimize on print) automatically if the Autominimize checkbox is selected in the configuration screen and the SAVE button is clicked.  If  MINIMIZE ON PRINT is set from the OPTIONS menu bar in the main window, minimize on print is active only for the current session of PRINTVB.  To save this setting, you must enter the Configuration window/screen and click SAVE.  Likewise, if the currently saved setting is Autominimize when PRINTVB is executed, then selecting MINIMIZE ON PRINT from the menu bar will turn off this feature (check mark is deleted) for the current session of PRINTVB, but the startup configuration is unaffected.

Related Topics: Contents


file_select
File Selection

The File Selection or File open dialog box is the standard windows "File Open" dialog with file name filters for .frm, .bas, .mak and .txt filenames.  In other words only files with these extensions can be opened.  If you use an include statement for a file with a name other than the above, a suggested approach is to rename the file so it satisfies the file name filter requirements.

PRINTVB attempts to detect if the selected file is a binary format file, but nothing is guaranteed, so please pay close attention to what you are printing else your printer may get an Excedrin headache printing all of the binary garbage that may result during print of a binary file.

Selection of a .mak file is automatically detected and you are provided with a dialog with a list box that includes all of the files in the .mak file and the .mak file.  At this point, you can choose one or more of the listed files for inclusion in the print job.

Related Topics: Contents


Fonts

Printer Fonts are accessible by software, and the Fonts/Install Fonts dialog provides a listing of all available printer fonts present in your system.  It is suggested that if you change printers often, then TrueType fonts should be selected for installation and use by PRINTVB.  If you remove fonts from Windows using the Control Panel approach, be certain to remove those fonts from the Installed Fonts list in the Fonts/Install Fonts dialog to prevent uncertain results.

Note that PRINTVB cannot do what cannot be done.  If you select a printer font supported by your printer and a font size that is not supported by your printer, your printer driver will either default to the next larger or smaller size automatically.  PRINTVB does not inform you if the selected font size is unavailable with your printer.  The best suggestion is to use True Type fonts for printing as they are fully scalable.

Related Topics: Contents


procedure_select
Procedure Selection

One significant feature of PRINTVB is the dialog window that enables selection of one or more procedures from your code listings to include in the printout.  This is particularly attractive if you are debugging one or just a few of the total number of procedures contained in a .frm or .bas file and you wish to save the paper required to print the undesired procedures.  Note that the left mouse button may be depressed and dragged over several vertically adjacent procedure names to select all of such procedures.  The Procedure Selection dialog is self-explanatory for the most part and should not present any difficulty to the user

The second entry in the list box of procedures "(general) / (declarations)" enables the user to print the general/declarations found within a module or form.  The exact processing includes a printout of the comments, external procedure declarations and variable dimensioning statements contained between the end of the form/control declarations and the beginning of the first procedure (sub or function).  If the user selects the "New Page Each Procedure" option in the Configure screen, then the general/declarations information can be printed on a separate page.  As in printing procedures, this portion of a module can be printed alone without printing any other code.  If no code is found in the general/declarations area of a file, PRINTVB opts to not print a blank page unless the general/declarations section is the only "procedure" selected in the Select Procedures window.

"Static" and "Private" procedures are recognized and listed in the Select Procedures window.

Related Topics: Contents


registration
Registration  Of PRINTVB Version 1.3a

Your economic support of our programming efforts is needed to encourage continued development of new and better quality software.  If you find PRINTVB useful, your support in the form of a registration of your copy of PRINTVB will be appreciated.  PRINTVB is a shareware program and continued use beyond a 30 day trial period is a violation of federal and state copyright laws.

PRINTVB is not to be distributed on a "for profit" basis as part of a shareware disk or shareware CD without the prior written consent of the author and agreed payment of a reasonable royalty for each copy sold.

To register your copy of PRINTVB and receive the latest updates and feature improvements, print and fill out the form shown below.  The form (below) can be printed by clicking on FILE/PRINT while viewing this page.

_____________________________________________________________________

Company or Individual Name

_____________________________________________________________________

Street Address (line 1)

_____________________________________________________________________

Street Address (line 2)

City_______________________________  State_____________  Zip______________

Country___________________	       CIS No._________________ AOL ID: __________

3.5"  floppy_______ 	5 1/4" floppy _______    (please check one item)

How did you obtain a copy of PRINTVB?

Compuserve ____  America OnLine ____  Other  ________________________________

Enclose a check or money order for $14.95 for each copy of PRINTVB you wish to purchase.  Include an additional $3.00 for shipping and handling expenses within the U.S.  Foreign Shipping Addressees should include $8.00 for shipping expenses.  Source code is available for an additional $10.00.  Send this order form to:

Kyle S. Brant

5441 Fenmore Road

Indianapolis, In 46208

Registration of PRINTVB entitles ONLY the owner of the registered version to install and use PRINTVB on more than one computer, so long as only one copy of PRINTVB is executing at any moment in time.

Site License rates:   5 users $50; 10 users $90; 25 users $200; 50 users $350; 100 users $600; 100+ users: $600 plus $5 times each additional user.

Bonus: for a limited time, persons registering will receive a discount certificate to obtain a shareware collection CD-ROM for only $9.95 plus s&h from JCS Marketing Inc.  This offer is valid through June 30 1994 per agreement with JCS Marketing Inc.


cisreg
Compuserve Registration in SWREG Forum

You can register PRINTVB through the SWREG forum of compuserve using the GO SWREG command.  Select register software and enter the PRINTVB Registration ID number  1482  when prompted.  The charge will occur on your next bill from Compuserve.  I will be informed of your registration vie E-mail and will respond with your new PRINTVB Registration number that you enter via the ABOUT window in PRINTVB.  Let me know in advance if you want a user name other than your own for the registration number.


rev_notes
Revision Notes

1.	Version 1.0 released in July 1993.  User feedback as to any bugs I have not found is encouraged.

2.	Version 1.1  Revised code so portrait or landscape printing works correctly.  Fixed print alignment minor bugs and added optional header line saved in INI file.

3.	Version 1.2  Revisions and Additions:

(a)	Print priority setting to give Windows the CPU at three different rates;

(b)	Option in configuration screen to print one procedure per page (or force form feed at beginning of new procedure);

(c)	Found and fixed print alignment bug that produced unaligned text on printers with resolution different from 300 dpi in line with two font sizes;

(d)	Added project (.mak) file recognition and new window giving user option to print all or some of files listed in project (.mak) file, including .mak file as optional file printed; this dialog/window is invoked each time the File Select result is a "*.mak" file.

(e)	Added additional information displayed on form during printing to indicate the name of the file currently being processed, as a means of tracking progress during print of a .mak file.

(f)	user is no longer able to install duplicate entries of the same font;  although this was not a bug, it would allow numerous entries of undesired fonts in installed fonts list

4.   Version 1.3 revisions and Additions:

(a)	Added Registration Code detection so user number entered would transform unregistered into registered version

(b)	Added detection of keywords "Static" and "Private" in subprocedure header so procedure list and printing of such procedures would take place

(c)	Added item "(general) / (declarations)" to procedure list so general declarations can be printed on separate page if desired

(d)	Modified use of Main screen label to display processing progress messages

(e)	Allowed print of programs with characters greater than 7F Hex so international characters will not prevent print of program; i.e., if the user wants to print binary files it can now be done.  Previously, a search for characters greater than 7F was the basis for detecting binary files and preventing printing of such file.  Now, only a warning is provided, and the user can proceed with printing ANY file to the printer.  Caution should be exercised so one does not print binary VB files.

(f)	Added cancel print form that is displayed upon clicking on PRINT command button to enable operator to cancel print operations at any time.

(g)	Revised code to achieve 15-30 percent speed improvement over version 1.2.  Actual results are dependent upon the particular printer driver and data required by the printer.  Obviously, use of a printer's internal fonts should provide the fastest print job, as is true of any of the available Windows Printing programs.  Note that the use of TrueType fonts requires generation of graphics data and transfer of that data to the printer and thus slows down printing versus the printing speed achieved using built in fonts of any printer.

(h)	Modified code so line-wrap would occur on Procedure names.  An oversight in the original code caused these to be truncated and not wrapped down to the next line if wider than the printable pagewidth.

(i)	Fixed a minor bug that would have cropped up if the comments in the program were identified using REM.  Seems I supplied a typo that read something like "IF 1>1" and it should have read "IF i>1".  Also found a misspelled variable name that caused the wrong font to be used under certain conditions in the printout.  I was not using the variable declaration feature of VB at that time.  Also fixed the code so that if a line was wrapped more than once, two leading characters in the line would not be lost.  I now know why it is worth being forced to declare or dimension variables.  These were tough ones to find!  Such is the joy of programming.

(j)	Finally figured out that you cannot shorten a file using binary access.  Some may have discovered that removing fonts from the installed font list did not always work, and that sometimes a remnant or partial font name remained in the printvb.ini file.   Well, it gets erased now!

Related Topics: Contents